package flower.com.fenzu35011111.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import flower.com.fenzu35011111.R;
import flower.com.fenzu35011111.base.Base_Z_Adapter;
import flower.com.fenzu35011111.base.MyApplication;
import flower.com.fenzu35011111.bean.Optionals;
import flower.com.fenzu35011111.dialog.ListViewActivity;


/**
 * Created by 他的猫 on 2016/12/3.
 * 我的went适配器
 */

public class CJ2_Adapter extends Base_Z_Adapter {
    CJ2_Adapter.Holder holder;


    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {

        // 查找控件
        if (null == convertView) {
            convertView = LayoutInflater.from(MyApplication.getInstance())
                    .inflate(R.layout.item_chengji2, null);
            holder = new CJ2_Adapter.Holder();
            holder.biaoti = (TextView) convertView
                    .findViewById(R.id.biaoti);
            holder.biaoti = (TextView) convertView
                    .findViewById(R.id.biaoti);
            holder.back = (LinearLayout) convertView
                    .findViewById(R.id.back);


            // 缓存Holder
            convertView.setTag(holder);
        } else {
            holder = (CJ2_Adapter.Holder) convertView.getTag();
        }
        Optionals teacher = (Optionals) mDataList.get(position);

        holder.biaoti.setText(teacher.getName());
        if (teacher.getZhiding() !=null  && teacher.getZhiding().equals("yes")) {
            holder.back.setBackgroundColor(MyApplication.getInstance().getColor(R.color.colorAccent));
        }


        return convertView;
    }

    public class Holder {
        LinearLayout back;
        TextView chengji;
        TextView shijian;
        TextView biaoti, leixing;


    }


}
